package com.lyy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lyy.entity.Video;
import com.lyy.entity.VideoOrder;
import com.lyy.mapper.VideoMapper;
import com.lyy.service.VideoService;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author Liangyaoyun
 */
@Data
public
class VideoServiceImpl implements VideoService {
    private VideoMapper videoMapper;

    @Override
    public int insertByVideoId(Video video) {
        return videoMapper.insertByVideoId(video);
    }

    @Override
    public int updateByVideoId(Video video) {
        return videoMapper.updateByVideoId(video);
    }

    @Override
    public int deleteByVideoId(Integer video) {
        return videoMapper.deleteByVideoId(video);
    }

    @Override
    public Video selectByVideoId(Integer video) {
        return videoMapper.selectByVideoId(video);
    }

    @Override
    public int deleteByVideoIds(List<Integer> videoId) {
        return videoMapper.deleteByVideoIds(videoId);
    }

    @Override
    public List<Video> selectAllVideo() {
        return selectAllVideo();
    }

    @Override
    public PageInfo<Video> selectBypage(Integer pageNumber, Integer pageSize) {
        PageHelper.startPage(pageNumber,pageSize);
        return new PageInfo<>(videoMapper.selectAllVideo());
    }
    @Override
    public List<Map<String, Integer>> starCount(){
        return videoMapper.starCount();
    }
}
